# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Sergiy Stupar <owner@sestolab.pp.ua>
pkgname=jshon
pkgver=20131105
pkgrel=2
pkgdesc="JSON parser designed for maximum convenience within the shell"
url="http://kmkeen.com/jshon/"
arch="all"
license="MIT"
makedepends="jansson-dev"
subpackages="$pkgname-doc"
source="https://github.com/keenerd/jshon/archive/$pkgver/jshon-$pkgver.tar.gz
	disable-werror.patch
	missing-typesh.patch
	"

build() {
	make
}

check() {
	echo '{"a":1,"b":[true,false,null,"none"],"c":{"d":4,"e":5}}' > sample.json
	[ "$(./jshon -F sample.json -k | xargs)" = 'a b c' ]
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}

sha512sums="
0f27cc8d0157bda12e5180f99b4e894326e7240d8cd004dadcadfad09f926852e224e3cd2b03cc6d51f7e7efafea0e5ccb1a0b66ab0d8349326809bc7db8ffb4  jshon-20131105.tar.gz
0f862ebcf1028cf2ad46610483df6b46e1f380b7b30605e672b342132fb1e123133d9c9672181d13217de5aa58e92522daf0eaa3537eacf810c978fbced364dc  disable-werror.patch
fc9a589cd39493c10e4616628040f19d758893545df59d2dc415d21eae12d8af12d5dd1fc160d0c95694086e5e86c8e9a463332dbab1fbd89babb606da139554  missing-typesh.patch
"
